# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-platypus
pkgver=1.2.0
pkgrel=2
pkgdesc="A Free and Open Source Python Library for Multiobjective Optimization"
url="https://github.com/Project-Platypus/Platypus"
arch="noarch"
license="GPL-3.0-or-later"
depends="python3 py3-numpy"
checkdepends="py3-pytest-xdist"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://github.com/Project-Platypus/Platypus/archive/$pkgver/platypus-$pkgver.tar.gz"
builddir="$srcdir/Platypus-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	rm -r "$pkgdir"/usr/lib/python3.*/site-packages/platypus/tests
}

sha512sums="
2c4cb3e260bcdf174bdb148552bec7c7c021a4b8f6ed8bd3c6e439e7007e3eb91edf8a5e5fb493ab2ae869d574bb30d79fc8635db3ac33a24fb192f77fe95d35  platypus-1.2.0.tar.gz
"
